<script type="text/javascript">
$(function(){
	var pdfName="";
	var paperNo="";
	$.get("printApplicationForm/getPDFInfo",function(data){

			var pdfPath = data.pdfPath;
			pdfName=data.pdfName;
			paperNo=data.paperNo;
			console.log("data.pdfName===>"+data.pdfName);
		
		/*	var html_pdf = '<object data ='+pdfPath
							+' type="application/pdf" width="100%" height="95%">'
							+'<iframe src='+pdfPath
							+' width="100%" height="95%" style="border: none;">'
							+'This browser does not support PDFs. Please download the PDF to view '
							+'it: <a href="">Download PDF</a>'
							+'</iframe>'
							+'</object>'; 
			$("#pdfView").append(html_pdf);
			
		*/
		
		//惠国磊  20180927 以下 12行
		var html_pdf = '<object data ="'
						+pdfPath
						+'" type="application/pdf" width="100%" height="95%">'
						+'<iframe src="'
						+pdfPath
						+'" width="100%" height="95%" style="border: none;">'
						+'This browser does not support PDFs. Please download the PDF to view '
						+'it: <a href="">Download PDF</a>'
						+'</iframe>'
						+'</object>'; 
		$("#pdfView").append(html_pdf);
			//$("object").attr("data","D:\\template\\"+item.credential_type+item.cardNo+"_print.pdf");
			//$("iframe").replaceAll("#pdf#",item.credential_type+item.cardNo+"_print.pdf");
	},"json");
	
	$("#printCredential").click(function(){
		//console.log("data.pdfPath===>"+pdfPath);
		$.ajax({
			type: 'POST',
			url: 'printCredentials/printCredentialPDF',
			data: {"pdfName":pdfName,"paperNo":paperNo},
			//data: radio_json,
			dataType: "json",
			cache: false
		});
	});
	//location.reload();

})


</script>
<!-- 方法1  -->
<!-- <embed src="app_cert_print.pdf" type="application/pdf" width="100%" height="100%"> -->

<!-- 方法2 如果浏览器不支持PDF，那么给到链接可以下载 -->
<div class="pageContent">
	<form method="post" action="demo/common/ajaxDone.html" class="pageForm">
	<div class="pageFormContent" layoutH="56">
		<div id="pdfView" layout="56" style="height:500px">
			
		</div>
		
				<!-- <object type="application/pdf" width="100%" height="95%">
				<iframe src="" width="100%" height="95%" style="border: none;">
				This browser does not support PDFs. Please download the PDF to view it: <a href="">Download PDF</a>
				</iframe>
				</object> -->
		<div class="formBar">
			<ul>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" id="printCredential">打印</button></div></div>
				</li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div>
				</li>
			</ul>			
		</div>
	</div>
	</form>
</div>